<?php
   class Comment extends AppModel {
        var $alias  =   'Comment';
        var $name = 'Comment';
        var $useTable = 'comments';
        var $belongsTo  =   array(
            'User'   =>  array(
                'className'     =>  'User',
                'foreignKey'    =>  'user_created',
                'fields'    =>  array('User.id', 'User.email')
            )
        );
        
        function paginateCount($conditions = null, $recursive = 0, $extra = array()) {
            $parameters = compact('conditions');
            $this->recursive = $recursive;
            $count = $this->find('count', array_merge($parameters, $extra));
            if (isset($extra['group'])) {
                $count = $this->getAffectedRows();
            }
            return $count;
        }

    }


?>
